package com.example.myapplication8;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class WorkActivity extends AppCompatActivity implements View.OnClickListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        EdgeToEdge.enable(this);
        setContentView(R.layout.work);
//        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
//            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
//            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
//            return insets;
//        });
        Button bt1=findViewById(R.id.btn_zhhao);
        bt1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
            Intent intent =new Intent(WorkActivity.this,MainActivity.class);
            intent.putExtra("登录","登陆成功");
                Toast.makeText(WorkActivity.this,"登录", Toast.LENGTH_SHORT).show();
                startActivity(intent);
                }
        });
        Button btn2=findViewById(R.id.btn_dlu);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent =new Intent(WorkActivity.this,MainActivity2.class);
                intent.putExtra("zhuce","登陆成功");
                Toast.makeText(WorkActivity.this,"注册", Toast.LENGTH_SHORT).show();
                startActivity(intent);
            }
        });

}

    @Override
    public void onClick(View view) {

    }
}
